import { Layout, RouterView } from '@/router/constant'

export default [
  {
    path: '/menu',
    name: 'Menu',
    component: Layout,
    redirect: '/menu/menu1',
    meta: {
      title: '嵌套菜单',
      permission: ['admin'],
    },
    children: [
      {
        path: '/menu/menu1',
        name: 'Menu1',
        component: () => import('@/views/menu/menu1/index.vue'),
        meta: {
          title: '菜单1',
          permission: ['admin'],
          hidden: true,
        },
      },
      {
        path: '/menu/menu2',
        name: 'Menu2',
        component: RouterView,
        meta: {
          title: '菜单2',
          permission: ['admin'],
        },
        redirect: '/menu/menu2/menu2-1',
        children: [
          {
            path: '/menu/menu2/menu2-1',
            name: 'Menu2-1',
            component: () => import('@/views/menu/menu2/menu2-1/index.vue'),
            meta: {
              title: '菜单2-1',
              permission: ['admin'],
            },
          },
          {
            path: '/menu/menu2/menu2-2',
            name: 'Menu2-2',
            component: () => import('@/views/menu/menu2/menu2-2/index.vue'),
            meta: {
              title: '菜单2-2',
              permission: ['admin'],
            },
          },
        ],
      },
    ],
  },
]
